//
//  CMBasicData.m
//  CardManage
//
//  Created by 斌 on 2017/11/7.
//  Copyright © 2017年 mupay. All rights reserved.
//

#import "CMBasicData.h"

@implementation CMBasicData
static NSMutableDictionary *allData;


+ (void)setData:(id)valueData key:(NSString *)keyString {
    
    if ([keyString isEqualToString:@"clean"]) {
        allData=[[NSMutableDictionary alloc]init];
        return ;
    }
    
    if (!allData) {
        allData=[[NSMutableDictionary alloc]init];
        
    }
    
    if ([allData objectForKey:keyString]) {
        [allData removeObjectForKey:keyString];
    }
    
    [allData setValue:valueData forKey:keyString];
}

+ (id)getData:(NSString *)pathString {
    
    NSArray *tempAr = [pathString componentsSeparatedByString:@"/"];
    
    NSDictionary *tempDict = allData;
    
    for (int i=0;i < tempAr.count;i++) {
        
        tempDict = [tempDict objectForKey:[tempAr objectAtIndex:i]];
        
    }
    
    if (!tempDict) {
        return @"";
    }
    
    return tempDict;
}
//MCLoginModel *merInfo;
//+ (void)setMerInfo:(MCLoginModel *)info {
//    
//    merInfo = info;
//    
//}
//
//+ (MCLoginModel *)getMerInfo {
//    
//    if (!merInfo) {
//        merInfo = [[MCLoginModel alloc] init];
//    }
//    
//    return merInfo;
//}
//
//
//MCGuideModel *guideInfo;
//+ (void)setGuideInfo:(MCGuideModel *)info{
//     guideInfo = info;
//}
//
//+ (MCGuideModel *)getGuideInfo{
//    if (!guideInfo) {
//        guideInfo = [[MCGuideModel alloc] init];
//    }
//    
//    return guideInfo;
//}

@end
